#include<iostream>
#include<unistd.h>
#include <sys/types.h>
#include <unistd.h>
#include<cassert> 
using namespace std;

int main()
{
  pid_t id;
  id = fork();
  assert(id != -1);
  if(id == 0)
  {
    int count = 10;
    while(count--)
    {
      cout<<"我是子进程，我的pid:"<<getpid()<<" ppid:" <<getppid()<<endl;
      sleep(1);
    }
    return 0;
  }
    cout<<"我是父进程，我的pid:"<<getpid()<<" ppid:" <<getppid()<<endl;
    sleep(3);
  return 0;
}
